<?php
require_once 'Zend/Db.php';
require_once 'Zend/Config/Ini.php';
//require_once 'FtpHelper.php';
/**
 * 主控受控使用的脚本
 * @author Administrator
 *
 */
class mvcresource{
	private function db()
    {   
        $params = array ('host' => '127.0.0.1',
                 'port' => '3309',
                 'username' => 'root',
                 'password' => 'yue@123',
                 'charset' => 'UTF8',
                 'dbname'   => 'test');
        $db = Zend_Db::factory('PDO_MYSQL', $params);
        return $db;
    }
	public function sync(){
		$db = $this->db();
		$db->query("truncate table r");
		$file = fopen("/tmp/mvcresource.txt","r");
		while(! feof($file))
  		{
			$db->query("insert into r(v) value('".trim(fgets($file))."')");
  		}
		fclose($file);
	}
}
$command = new mvcresource();
$command->sync();
/*
$cmd=$argv[1]; 
if($cmd=="data"){
	$command = new syncmd();
	$command->runsyncdata();
	$command->runsyncimg();
	$command->runrenewXml();
	syslog(LOG_INFO, ": commands - syncmd.runsyncdata");
}
elseif($cmd=="innerdata"){
	$command = new syncmd();
	$command->runsyncdata(1);
	$command->runsyncimg();
	$command->runsyncuuid();
	$command->runrenewXml();
	//导出节目生成静态化的文件
	$command->runstaticexportXml();
	syslog(LOG_INFO, ": commands - syncmd.innerdata");
}
elseif($cmd=="file"){
	$command = new syncmd();
	$command->runsyncfile();
	syslog(LOG_INFO, ": commands - syncmd.runsyncfile");
}*/
